package com.ljf.authority.service;

import com.ljf.authority.dto.command.AuthorityBaseApiTabulationActivationCommand;
import com.ljf.authority.dto.command.AuthorityBaseApiTabulationCommand;
import com.ljf.authority.dto.command.AuthorityBaseApiTabulationMenuCommand;
import com.ljf.authority.dto.command.AuthorityBaseApiTabulationTemplateCommand;
import com.ljf.authority.dto.query.AuthorityBaseApiTabulationQuery;
import com.ljf.authority.vo.AuthorityBaseApiTabulationInfoVO;
import com.ljf.authority.vo.AuthorityBaseApiTabulationMenuVO;
import com.ljf.authority.vo.AuthorityBaseApiTabulationVO;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ServiceResultModel;
import com.ljf.common.service.IBasisService;

/**
 * API列表定义  服务接口定义
 * 
 * @author LJF
 * @since 2024-10-24
 */
public interface IAuthorityBaseApiTabulationService extends IBasisService<AuthorityBaseApiTabulationQuery, AuthorityBaseApiTabulationVO, AuthorityBaseApiTabulationCommand> {

    /**
     * 校验接口权限
     *
     * @param user
     * @param url
     * @param method
     * @return
     * @throws ServiceException
     */
    boolean checkAuthorityApi(String user, String url, Integer method) throws ServiceException;

    /**
     * 通过模板批量新增API列表定义
     *
     * @param command
     * @return
     * @throws ServiceException
     */
    ServiceResultModel addBatchByTemplate(AuthorityBaseApiTabulationTemplateCommand command) throws ServiceException;

    /**
     * 修改API列表定义激活状态
     *
     * @param command
     * @return
     * @throws ServiceException
     */
    ServiceResultModel editActivation(AuthorityBaseApiTabulationActivationCommand command) throws ServiceException;

    /**
     * 修改API列表定义关联菜单
     *
     * @param command
     * @return
     * @throws ServiceException
     */
    ServiceResultModel editMenu(AuthorityBaseApiTabulationMenuCommand command) throws ServiceException;

    /**
     * 查询API列表表单信息
     *
     * @param url
     * @param method
     * @return
     * @throws ServiceException
     */
    ServiceResultModel<AuthorityBaseApiTabulationInfoVO> queryInfo(String url, Integer method) throws ServiceException;

    /**
     * 查询API列表模板
     *
     * @param tableName
     * @return
     * @throws ServiceException
     */
    ServiceResultModel<AuthorityBaseApiTabulationInfoVO> queryTemplate(String tableName) throws ServiceException;

    /**
     * 根据ID查询API列表关联菜单
     *
     * @param id
     * @return
     * @throws ServiceException
     */
    ServiceResultModel<AuthorityBaseApiTabulationMenuVO> queryMenuById(Long id) throws ServiceException;

}
